#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>


int Is_lily_number(int x)
{
    int sum = 0;
    int n = 1;
    while (x / n != 0)
    {
        sum += (x / n) * (x % n);
        n *= 10;
    }
    if (sum == x) {
        return 1;
    }
    else {
        return 0;
    }
}


int main() {
    for (int i = 10000; i <= 99999; ++i)
    {
        if (Is_lily_number(i))
        {
            printf("%d ", i);
        }
    }
    return 0;
}